<template>
<div class="platform-package views-container">
  <div class="wlm-table">
    <div class="wlm-table-hearder-btn">
      <router-link tag="span" to="/operation/platformPackageAdd">
        <el-button size="small" type="primary">添加套餐</el-button>
      </router-link>
    </div>
    <div class="wlm-table-content">
      <el-table :ref="tableFormatData.platformPack.key" :data="tableFormatData.platformPack.tableData" @selection-change="handleSelectionChange" style="width: 100%">
        <el-table-column  width="20">
        </el-table-column>
        <el-table-column prop="date" label="套餐名称" header-align="left" align="left">
          <template slot-scope="scope">
            <span>{{scope.row.title}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="date" label="套餐简介" header-align="left" align="left">
          <template slot-scope="scope">
            <span>{{scope.row.content}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="平台数量" header-align="left" align="left">
          <template slot-scope="scope">
            <span>{{scope.row.accountNum}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="所属产品" header-align="left" align="left">
          <template slot-scope="scope">
            <span>{{scope.row.productName}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="排序" header-align="left" align="left">
          <template slot-scope="scope">
            <span>{{scope.row.sort}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="状态" header-align="left" align="left">
          <template slot-scope="scope">
            <el-switch :active-value="1" :inactive-value="0" @change="changeTableItem({id:scope.row.id,is_show:scope.row.is_show},tableFormatData.platformPack.change.is_show)" v-model="scope.row.status"> </el-switch>
          </template>
        </el-table-column>
        <el-table-column prop="address" label="操作" header-align="left" align="left">
          <template slot-scope="scope">
             <div class="operation-group">
                <router-link class="wlm-text" tag="span" :to="{path:'/operation/platformPackageAdd', query:{id:scope.row.id}}">
                  <el-button type="text">编辑</el-button>
                </router-link>
                <div class="btn-line"></div>
                <el-button class="wlm-text" type="text" @click="delTableItem(scope.row.id)">删除</el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</div>
</template>

<script>
import {
  packageList,
  packageDelData
} from '@/api/operation'
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Table')],
  name: 'PlatformPackage',
  components: {

  },
  data() {
    return {
      tableFormatData: {
        current: 'platformPack',
        platformPack: {
          key: 'platformPack',
          api: {
            getList: packageList,
            delList: packageDelData
          },
          tableData: [],
          files: {
            ids: [],
            checkall: '0'
          },
          noPages: true,
          // change: {
          //   is_show: {
          //     name: '编辑',
          //     key: 'is_show',
          //     api: messageSta
          //   }
          // },
          pagination: {
            pindex: 1,
            psize: 10,
            pagesizes: [10, 20, 50],
            total: 10
          }
        }
      }
    }
  },
  methods: {

  }
}
</script>

<style lang="scss" scoped>
.platform-package {

}
</style>
